import axios from '../utils/http'

const CateStore = {
    namespaced: true,
    state: ()=>({
        cate_list: []
    }),
    mutations: {
        CateMutation(state,list){
            state.cate_list = list
        }
    },
    actions: {
        CateAction(context){
            axios.get("/api/catelist?istree=1").then(
                res=>{
                    if(res.code === 200){
                        context.commit('CateMutation',res.list)
                    }
                }
            )
        }
    }
}

export default CateStore